package com.zjw.designPattern.singleton;

/**
 * 懒汉式，线程安全(性能不佳，不推荐使用)
 */
public class SingletonLazy {

    private SingletonLazy() {
    }

    public static SingletonLazy singletonLazy;

    public SingletonLazy getSingletonDCL() {

        synchronized (singletonLazy) {
            if (singletonLazy == null) {
                singletonLazy = new SingletonLazy();
            }
        }

        return singletonLazy;
    }
}
